<?php

class Login_Controller extends CI_Controller {

    protected $data = array();

    public function __construct() {
        parent::__construct();
        $this->load->helper('url');
        
        if (empty($_SESSION['user_info']) == TRUE) {
            $this->data['base_url'] = base_url();
            $this->data['base_theme'] = base_url('assets/theme/frontend');
            $this->load->library('Template');
            $this->template->set_template('login');
            $this->template->parse_view('head', 'frontend/template/block/01.head.php', $this->data);
            $this->template->parse_view('header', 'frontend/template/block/02.header.php', $this->data);
            $this->template->parse_view('left', 'frontend/template/block/03.left.php', $this->data);
            $this->template->parse_view('footer', 'frontend/template/block/04.footer.php', $this->data);
            $this->template->parse_view('footer_js', 'frontend/template/block/05.footer_js.php', $this->data);
        } else {            
            redirect(base_url('home'));
        }
    }

}
